home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / italic.sty < prev    next >
Text File  |  1993-01-11  |  1KB  |  39 lines

  1. % Save file as: ITALIC.STY             Source: FILESERV@SHSU.BITNET  
  2. %
  3. %  File:    ITALIC.STY
  4. %
  5. %  Author:    Hunter Goatley
  6. %        goathunter@WKUVX1.BITNET
  7. %
  8. %  Date:    August 21, 1991
  9. %
  10. %  Abstract:
  11. %
  12. %    The macros \ital and \slant are defined to typeset tex in italic
  13. %    (\it) and slanted (\sl) fonts, automatically inserting the italic
  14. %    correction (\/) if necessary.  The correction is not inserted if
  15. %    the token following the parameter is a period or a comma, as
  16. %    suggested on page 14 of _The TeXbook_.
  17. %
  18. %    Based on the \predict macro presented in _TeX for the Impatient_,
  19. %    p. 233.
  20. %
  21. %    These macros use \toks0 as a temporary.
  22. %
  23. %    The \futurelet\it@next in \ital and \slant defines \it@next to be
  24. %    whatever the character following the parameter is.  \d@slant checks
  25. %    to see if \it@next is a comma or period; if it is neither, the
  26. %    italic correction (\/) is included.
  27. %
  28. \catcode`\@=11                % Temporarily make @ a letter
  29. \def\ital#1{\toks0={#1}\let\slf@nt=\it\futurelet\it@next\d@slant}
  30. \def\slant#1{\toks0={#1}\let\slf@nt=\sl\futurelet\it@next\d@slant}
  31. \def\d@slant{{\slf@nt\the\toks0}%
  32.     \ifx\it@next,%            % If \it@next is not a comma
  33.     \else\ifx\it@next.%        % ... and is not a period
  34.     \else\/%            % ... insert the correction (\/)
  35.     \fi\fi%                % ...
  36.     \let\it@next=\relax%        % "Undefine" \it@next
  37.     }
  38. \catcode`\@=12                % Reset @ as other
  39.